package web;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author bbaquero
 */
public class MenuArtistas extends HttpServlet {

    /** 
     * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        try {

            out.println("<html>");
            out.println("<head>");
            out.println("<title>Menu Artistas</title>");
            out.println("</head>");
            out.println("<body bgcolor=#313131><center>");
            char inicial = 'A';
            out.println("<div style=>");
            out.println("<div style=\"position: absolute;top: 3;left: 0;z-index: 1;\">" +
                    "<img src=imgs/words1.png> </div>");
            out.println("<div style=\"position: absolute;top: 12px;left: 230px;\">");
            out.println("<a href=MostrarArtista?ini=# target=_parent style = \"text-decoration: none; z-index: 0;\"><font face=verdana color=white><b>0-9&nbsp;&nbsp;</b></font></a>");
            int c = 0;
            do {
                char ini = inicial++;
                out.println("<a href=\"MostrarArtista?ini=" + ini + "\" target=_parent" +
                        " style = \"text-decoration: none; z-index: 0;\"><font face=verdana color=white><b>" + ini + "&nbsp;&nbsp;</b></font></a>");
                c++;
            } while (c <= 25);
            out.println("</div></center></body>");
            out.println("</html>");
        } finally {
            out.close();
        }
    }

    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /** 
     * Handles the HTTP <code>GET</code> method.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
    }

    /** 
     * Handles the HTTP <code>POST</code> method.
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
    }

    /** 
     * Returns a short description of the servlet.
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return "Short description";
    }// </editor-fold>
}
